<template> 
    <div> 
        <button @click="add"> 我是子组件 </button>
    </div> 
  </template>
  <script> 
    export default { 
        props: ['msg'],
        data(){
            return { 
                param: 100,
            }
        },

        methods: {
            add(){
                this.param +=1;
                this.$emit('toparent',this.param)
            }
        },
        created() {
            
            this.$emit('toparent',this.param)
        },
 
    }
  </script>
 
  